home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
tpstuff2.arc
/
MOUSE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-04-21
|
2KB
|
53 lines
{ Mousketch }
{ Copied from an article by Jeff Duntemann published in the October '84 issue
of PC Tech. Journal }
Program Mousketch;
type RegPack = record
AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : Integer;
end;
VAR OldX, OldY, X, Y : Integer;
M1, M2, M3, M4 : Integer;
RegSet : RegPack;
Procedure Mouse(var m1, m2, m3, m4 : integer);
VAR RegSet : RegPack;
BEGIN
WITH RegSet DO
BEGIN {Set up AX, BX, CX, and DX for interrupt}
AX := m1;
BX := m2;
CX := m3;
DX := m4;
END;
INTR(51,RegSet); {trip interrupt 51}
WITH RegSet DO
BEGIN
m1 := AX;
m2 := BX;
m3 := CX;
m4 := DX;
END
END; {Procedure Mouse}
Begin
HIRES; {Choose graphics mode & color}
HIRESCOLOR(YELLOW);
M1 := 0; {Init. mouse driver}
mouse(M1, M2, M3, M4);
M1 := 1; {Turn mouse cursor on}
mouse(M1, M2, M3, M4);
M1 := 3; OldX := 0; OldY := 0;
WHILE NOT KEYPRESSED DO {Exit Mousketch when any key pressed}
BEGIN
mouse(M1, M2, M3, M4);
IF M2 <> 0 THEN DRAW(OldX, OldY, M3, M4, 1); {Draw if button pressed}
OldX := M3; {Update old X/Y values}
OldY := M4;
END
END.